/*
 * A Gneral purpose java based Genome Library created by Susanta Tewari.
 * Copyright is protected. Contact Susanta Tewari at <statsusant@yahoo.com>
 */

package genomemap.data;

import genomemap.data.DataSource;
import genomemap.data.PDataSource;

/**
 *
 * @author Susanta Tewari <stewari@yahoo.com>
 */
public class HybridDataPool {

    /** Field description */
    private final int[][][] masterHybridData = new int[7][][];

    /**
     * @throws RuntimeException
     * @param ch_id
     * @param cloneOrder
     * @return
     */
    public int[][] getHybridData(int ch_id) {

        if (masterHybridData[ch_id - 1] == null) {

            PDataSource pData = DataSource.getPDataSource(ch_id);

            masterHybridData[ch_id - 1] = pData.getHybridData();
        }

        if (masterHybridData[ch_id - 1] == null) {

            throw new RuntimeException("Hybrid Data for Chromosome- " + ch_id
                                       + "can not be loaded.");
        }

        return masterHybridData[ch_id - 1];
    }
}
